package com.hruiworks.campusgroup.service;

import com.hruiworks.campusgroup.pojo.entity.Activity;
import com.hruiworks.campusgroup.pojo.entity.Group;
import com.hruiworks.campusgroup.pojo.entity.User;

import java.time.temporal.TemporalUnit;
import java.util.List;

/**
 * 通知相关
 */
public interface NoticeService {

    /**
     * 活动开始前默认提醒
     */
    void groupStartNoticeDefaultTime(User user, Group group, Activity activity);

    /**
     * 小于开始前30分钟的活动直接通知
     * @param user
     * @param group
     * @param activity
     */
    void groupStartNoticeImmediately(User user, Group group, Activity activity);

    /**
     * 设置活动开始提醒时间
     * @param user
     * @param group
     * @param activity
     * @param timeBeforehand
     * @param unit
     */
    void groupStartNoticeCertainTime(User user, Group group, Activity activity, Long timeBeforehand, TemporalUnit unit);

    /**
     * 修改活动提醒时间
     * @param user
     * @param group
     * @param timeBeforehand
     * @param unit
     */
    void groupStartNoticeChangeTime(User user, Group group, Long timeBeforehand, TemporalUnit unit);

    /**
     * 活动上线即时提醒
     * @param activity 新活动
     */
    void newActivityNoticeInstant(Activity activity);

    /**
     * 用户未读信息数量初始化
     * @param user
     * @return
     */
    Integer userUnreadInitial(User user);

    /**
     * 读完消息后仍未读的信息
     * @param user
     * @param offsetStr 偏移量字符串，前端传递用1,2,5的格式进行传递
     * @return 返回还剩的count
     */
    Integer userRead(User user, String offsetStr);

    /**
     * 新成员加入提醒
     * @param userIds
     */
    void newMemberNotice(String university, List<Long> userIds, String message);

}
